{extend name="base" /}
<!-- page specific plugin styles -->
{block name="inline-styles"}
{/block}
<!-- PAGE CONTENT BEGINS -->
{block name="content"}
<div class="page js_show">
    <div class="page__bd">
        <form class="weui-cells weui-cells_form" id="ajaxForm">
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">新密码</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="password" name="password" placeholder="不少于6位">
                </div>
            </div>
        </form>

        <div class="weui-btn-area">
            <a class="weui-btn weui-btn_primary" href="javascript:;" id="showToast">确定</a>
        </div>

        <div class="weui-cells__tips">温馨提示：初始密码为手机号码后六位！</div>
    
    </div>
    <div class="page__ft">
        <div class="weui-footer weui-footer_fixed-bottom">
            <p class="weui-footer__links">
                <a href="javascript:void(0);" class="weui-footer__link">米粒生活</a>
            </p>
            <p class="weui-footer__text">Copyright © 2008-2018 mlilife.com</p>
        </div>
    </div>
</div>
{/block}
<!-- PAGE CONTENT ENDS -->
<!-- inline scripts related to this page -->
{block name="related-scripts"}
<script type="text/javascript">
    $("#showToast").click(function(event) {
        /* Act on the event */
        var options={
            url:"/api/v1/member/xgmm",
            type:"POST",
            dataType:"json",
            success: function(json){

                if(json.returnCode==1){
                    $.toast("修改成功", function() {
                        window.location.href = "{:url('Index/login')}";
                    });
                }else{
                    $.toptip(json.returnMsg, 'error');
                }
            }
        };
        $("#ajaxForm").ajaxSubmit(options)
    });
</script>
{/block}